<script setup lang="ts">
// import { localStorage } from '@/utils/local-storage'
import { useThemeStore } from "@/stores";
import { storeToRefs } from "pinia";
import { getFingerprint } from "@/utils/index"

// const store = useStore()
const themeStore = useThemeStore();
const { theme } = storeToRefs(themeStore);
getFingerprint()
// const theme = ref<ConfigProviderTheme>('dark')
// const mode = computed(() => store.mode)

// watch(mode, (val) => {
//   if (val === 'dark' || localStorage.get('theme') === 'dark') {
//     theme.value = 'dark'
//     document.querySelector('html')
//       .setAttribute('data-theme', 'dark')
//   }
//   else {
//     theme.value = 'light'
//     document.querySelector('html')
//       .setAttribute('data-theme', 'light')
//   }
// }, { immediate: true })

provide(
  "isRealDark",
  computed(() => theme.value === "dark")
);
</script>

<template>
  <VanConfigProvider :theme="theme">
    <RouterView />
  </VanConfigProvider>
</template>
